package cn.tedu.micro.demo.websocket.controller;

import cn.tedu.micro.demo.websocket.points.WebsocketServerPoint;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class MsgController {
    @Autowired
    private WebsocketServerPoint websocketServerPoint;

    @GetMapping("/push")
    public String push(Integer userId,String message){
        websocketServerPoint.pushMsg(message,userId);
        return "推送成功";
    }
}
